import serial.tools.list_ports
import binascii

import json

class dao:
    def __init__(self):
        super(dao,self).__init__()
        self.ser_send = None
        self.baud = None
        self.plist = None
        self.serial_port = None
        self.com_list = []

    def get_com_list_function(self):
        self.plist = list(serial.tools.list_ports.comports())
        # self.plist = serial.tools.list_ports.comports()

        if len(self.plist) > 0:
            for i in range(len(self.plist)):
                self.com_list.append(list(self.plist[i])[0])
                # self.com_list.append(str(self.plist[i]))
        return self.com_list, self.com_list[0]


